<%--
  Created by IntelliJ IDEA.
  User: admin
  Date: 2024-9-24
  Time: 23:23
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <style>
        .container {
            display: flex;        /* Use flexbox layout */
            /*justify-content: center; !* Center horizontally *!*/
            padding: 20px;
            /*align-items: center;     !* Center vertically *!*/
            /*height: 100vh;          !* Full height of the viewport *!*/
        }

        form {
            /* Style the form as needed */
            padding: 20px;
            /*border: 1px solid #ccc;*/
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }
    </style>
</head>
<body>
<div class="container">
<form action="" method="post" name="form">
    这里是调料柜台，请选择您要购买的调料：
    <br />
    <div>
        <input type="checkbox" name="food" value="调和油">调和油
    </div>
    <div>
        <input type="checkbox" name="food" value="强化盐"> 强化盐
    </div>
    <div><input type="checkbox" name="food" value="多维醋">
    多维醋
    </div>
    <div><input type="checkbox" name="food" value="绿色调料">
    绿色调料
<%--    <br />--%>
    </div>
    <div>
        <input type="submit" value="购物" name="submit">
    </div>
    <p>
        <a href="shoppingCart.jsp"> 欢迎修改会员卡号！</a>
        <a href="count.jsp"> 欢迎查看购物车！</a>
    </p>
    <%
        request.setCharacterEncoding("utf-8");
        String goods[] = request.getParameterValues("food");
        if (goods != null && goods.length != 0) {
            for (int i = 0; i < goods.length; i++) {
                session.setAttribute(goods[i], goods[i]);
            }
        }
    %>
</form>
</div>
</body>
</html>
